package com.longagoewk.springboot.controller.clientController;

import com.longagoewk.springboot.entity.ExplainBean;
import com.longagoewk.springboot.service.ExplainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.util.ArrayList;
import java.util.List;


@Controller
public class hallController {

    @Autowired
    ExplainService explainService;

    @RequestMapping("/selectHall")
    public ModelAndView SelectHall(String hname){
        ModelAndView view = new ModelAndView();
        ExplainBean explainBean = new ExplainBean();
        explainBean.setHname(hname);
        List<ExplainBean> list = new ArrayList<>();
        list = explainService.getExplainList(explainBean);
        view.addObject("explainList",list);
        view.addObject("title",hname+"厅");
        view.setViewName("client/hall");
        return view;
    }

}
